#include "empty.h"

#ifndef __APP_H
#define __APP_H


typedef enum {
    TIMEOUT = 0,
    CROSS = 1,
    TIMEOUT_CROSS = 2,
	TIMEOUT_CROSSMID = 3,
    PULSE = 4,
    TIMEOUT_PULSE = 5
} stateJudge_mode;


typedef enum {
    ONE_FORWARD_GRAY = 0,               // 前进一格 + 灰度循迹
    PULSE_ = 1,                         // 位置
    PULSE_GRAY = 2,                     // 位置 + 灰度循迹
	PULSE_GRAY_TURN = 3,                // 位置 + 灰度转弯
	TIMEOUT_GRAY = 4,                   // 超时 + 灰度循迹
	TIMEOUT_GRAY_TURN = 5,              // 超时 + 灰度转弯
    SMALL_FORWARD = 6                   // 转弯小前进 + 无灰度
} straight_mode;


typedef enum {
    LEFT_90 = 0,              
    RIGHT_90 = 1,    
    LEFT_180 = 2,
    RIGHT_180 = 4,
    LEFT_PID = 5,              
    RIGHT_PID = 6,
	LEFT_PID_FILTER = 7,              
    RIGHT_PID_FILTER = 8 	
} rotate_mode;


void APP_Init(void);
void APP_stateJudge(uint32_t count, stateJudge_mode mode, int pulse);
void APP_Straight(straight_mode mode, int Pulse, int timeout);
void APP_Rotate(rotate_mode mode, float target_angle);
void APP_Adjust(uint8_t mode, float target_angle, int time);
void APP_Move(uint8_t object);
void APP_Task(void);
void APP_GPIO_Init(void);

#endif


